package com.dwxt.cdms.dao;

import com.dwxt.cdms.entity.HealthMessage;
import com.dwxt.cdms.entity.HealthWarnRecord;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface HealthWarnRecordMapper extends Mapper<HealthWarnRecord> {
    List<Map> selectHealthRecordPage(@Param("name") String name, @Param("community") String community,
                                     @Param("orderBy") String orderBy, @Param("isHandle") Integer isHandle,
                                     @Param("stationId")Integer stationId,@Param("category") String category,
                                     @Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<Map> selectAllWarnPage(@Param("customerId") String customerId,@Param("stationId") Integer stationId,@Param("isHandle")Integer isHandle);

    Integer selectAllWarnGraphHour(@Param("start") int start, @Param("end") int end,@Param("stationId")Integer stationId);

    Integer selectAllCount(@Param("stationId")Integer stationId);

    Integer selectTodayCount(@Param("stationId")Integer stationId);

    Integer selectCurrentMonthCount(@Param("stationId")Integer stationId);

    Integer selectFinishCount(@Param("stationId")Integer stationId);

    Integer selectAllWarnGraphMonth(@Param("month") int month,@Param("stationId")Integer stationId);

    Integer countNotHandleWarn(@Param("stationId")Integer stationId);

    List<HealthWarnRecord> selectChanged();

    List<HealthWarnRecord> findHighHeart( @Param("start")Date start, @Param("end")Date end);

    List<HealthWarnRecord> findTemperature(@Param("start")Date start,  @Param("end")Date end);

    List<HealthWarnRecord> findBloodOxygen(@Param("start")Date start, @Param("end")Date end);

    void insertMessage(HealthMessage healthMessage);

    List<HealthMessage>  getRelateIdsByUserId(Integer id);

    HealthMessage getUsernameAndSex(Integer id);

    Long getCountByCustomerIdcustomerId(Integer id);

    Map selectAllDataCount(@Param("stationId")Integer stationId);

    Integer getAllCount();

    List<Map> selectWarnByCutomerIdOrPhone(Integer customerId, String phone);


    Map selectCountForCommunity();
}